import os
from PIL import Image
#import matplotlib.pyplot as plt

# 会在原有的图片数据做扩充，数据存储在了flower_photos中，为了保存初始的数据，保存在了origin_flower_photos中

flowe_classes = ['bee_balm','blackberry_lily','blanket_flower','bougainvillea','bromelia','foxglove']

for name in flowe_classes:
    a = os.listdir('/Users/guasen/Projects/AI/实验二深度学习-花卉识别/花卉图像识别/flower_photos/'+name)
    count = 1
    print(name)
    for x in a:
        #print(x)
        
        img=Image.open('/Users/guasen/Projects/AI/实验二深度学习-花卉识别/花卉图像识别/flower_photos/'+name+'/'+x)
        dst=img.transpose(Image.FLIP_LEFT_RIGHT)#左右互换
        newname='/Users/guasen/Projects/AI/实验二深度学习-花卉识别/花卉图像识别/flower_photos/'+name+'/'+name+'_'+str(count)+'.jpg'
        dst=dst.convert('RGB')
        dst.save(newname)
        count += 1
